<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>
        <p:dialog id="CampanhaEditDlg" widgetVar="CampanhaEditDialog" modal="true" resizable="false"  appendTo="@(body)" header="#{bundle.EditCampanhaTitle}" closeOnEscape="true">

            <h:form id="CampanhaEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{campanhaController.selected != null}">

                        <h:outputLabel value="#{bundle.EditCampanhaLabel_id}" for="id" />
                        <h:panelGroup>
                            <h:outputText id="id" value="#{campanhaController.selected.id}" />
                            <p:tooltip for="id" value="#{campanhaController.getComponentMessages('id', bundle.EditCampanhaHelpText_id)}"/>
                        </h:panelGroup>


                        <p:outputLabel value="#{bundle.EditCampanhaLabel_nome}" for="nome" />
                        <h:panelGroup>
                            <p:inputText id="nome" value="#{campanhaController.selected.nome}" title="#{bundle.EditCampanhaTitle_nome}" required="true" requiredMessage="#{bundle.EditCampanhaRequiredMessage_nome}" size="255" maxlength="255"/>
                            <p:tooltip for="nome" value="#{campanhaController.getComponentMessages('nome', bundle.EditCampanhaHelpText_nome)}"/>
                        </h:panelGroup>


                        <p:outputLabel value="#{bundle.EditCampanhaLabel_vigenteDesde}" for="vigenteDesde" />
                        <h:panelGroup>
                            <p:calendar id="vigenteDesde" pattern="MM/dd/yyyy HH:mm:ss" value="#{campanhaController.selected.vigenteDesde}" title="#{bundle.EditCampanhaTitle_vigenteDesde}" required="true" requiredMessage="#{bundle.EditCampanhaRequiredMessage_vigenteDesde}" showOn="button"/>
                            <p:tooltip for="vigenteDesde" value="#{campanhaController.getComponentMessages('vigenteDesde', bundle.EditCampanhaHelpText_vigenteDesde)}"/>
                        </h:panelGroup>


                        <p:outputLabel value="#{bundle.EditCampanhaLabel_vigenteAte}" for="vigenteAte" />
                        <h:panelGroup>
                            <p:calendar id="vigenteAte" pattern="MM/dd/yyyy HH:mm:ss" value="#{campanhaController.selected.vigenteAte}" title="#{bundle.EditCampanhaTitle_vigenteAte}"  showOn="button"/>
                            <p:tooltip for="vigenteAte" value="#{campanhaController.getComponentMessages('vigenteAte', bundle.EditCampanhaHelpText_vigenteAte)}"/>
                        </h:panelGroup>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{campanhaController.save}" value="#{bundle.Save}" update="display,:CampanhaListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,CampanhaEditDialog);">
                        <p:confirm header="#{bundle.ConfirmationHeader}" message="#{bundle.ConfirmEditMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>
                    <p:commandButton value="#{bundle.Cancel}" onclick="CampanhaEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
